package two;

import java.util.Scanner;

public class carTest {
    public static void main(String[] args) {
        car[] arr = new car[3];
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < arr.length; i++) {
            car c = new car();
            System.out.println("请输入汽车品牌");
            String brand = sc.next();
            c.setBound(brand);
            System.out.println("请输入汽车价格");
            int price = sc.nextInt();
            c.setPrice(price);
            System.out.println("请输入汽车颜色");
            String colour = sc.next();
            c.setColour(colour);

            arr[i] = c;


        }
        for (int i = 0; i < arr.length; i++) {
            car car = arr[i];
            System.out.println(car.getBound()+","+car.getPrice()+","+car.getColour());
        }

    }
}
